package org.cl.persist.system.controller;

import org.cl.persist.system.service.impl.MenuServiceImpl;
import org.springboot.gls.ex.request.ret.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author cl
 */
@RestController
@RequestMapping("/menu")
public class MenuController {

    @Autowired
    private MenuServiceImpl menuService;

    @GetMapping("/gets")
    public R gets() {
        return R.ok(menuService.list());
    }

    @GetMapping("/getLeft")
    public R getLefts() {
        return R.ok(menuService.getLeftTreeMenu(0 + ""));
    }
}
